<?php
$arrStatistic = $this->arrStatistic;
global $arrSite;
$arrSiteIDCode = $this->arrSiteIDCode;
$strQuery = $this->query;
$strSiteCode = $this->strSiteCode;
if(count($arrStatistic) >0 )
{

    $intAll = array_sum($arrStatistic);
?>
    <ul>
        <li class="menu_cap1">Chuyên mục</li>
        <?php
        if($strQuery!='')
        {
            if($strSiteCode=='')
            {
            ?>
            <li <?php  echo 'class="active"';?>>
                <a href="<?php echo BASE_URL.'/?q='.$strQuery; ?>">
                    Tất cả &nbsp;(<?php echo $intAll;?>)
                </a>
            </li>
            <?php
            }
            else
            {
            ?>
            <li>
                <a href="<?php echo BASE_URL.'/?q='.$strQuery; ?>">
                    Tất cả &nbsp;<span class="txt_gray">(<?php echo $intAll;?>)</span>
                </a>
            </li>
            <?php
            }
            ?>
            <?php
            foreach($arrStatistic as $key=>$dataStatistic)
            {
                $active='';
                if($arrSiteIDCode[$key] == $strSiteCode)
                {
            ?>
                <li class="active">
                    <a href="<?php echo BASE_URL.'/'.$arrSiteIDCode[$key].'/?q='.$strQuery; ?>">
                        <?php echo $arrSite[$key]['name'];?>&nbsp;(<?php echo $dataStatistic;?>)
                    </a>
                </li>
            <?php
                }
                else
                {
           ?>
                <li>
                    <a href="<?php echo BASE_URL.'/'.$arrSiteIDCode[$key].'/?q='.$strQuery; ?>">
                        <?php echo $arrSite[$key]['name'];?>&nbsp;<span class="txt_gray">(<?php echo $dataStatistic;?>)</span>
                    </a>
                </li>
       <?php
                }
            }
        }
       ?>
    </ul>
    <ul>
        <?php

        $strUriMain = $this->strUriMain;
        ?>
        <li class="menu_cap1">Media</li>
        <?php
            if($strQuery!='')
            {
            ?>
                <li <?php if($this->intMediaType==-1) echo 'class="active"';?>>
                    <a href="<?php echo $strUriMain; ?>">Tất cả</a>
                </li>
                <li <?php if($this->intMediaType==0) echo 'class="active"';?>>
                    <a href="<?php echo $strUriMain.'&text=on'; ?>">Tin bài</a>
                </li>
                <li <?php if($this->intMediaType==2) echo 'class="active"';?>>
                    <a href="<?php echo $strUriMain.'&video=on'; ?>">Video</a>
                </li>
                <li <?php if($this->intMediaType==1) echo 'class="active"';?>>
                    <a href="<?php echo $strUriMain.'&image=on'; ?>">Ảnh</a>
                </li>
            <?php
            }
            ?>
    </ul>
<?php
}
?>
